package com.groupe_A.metier;

/**
 * @author mohssine
 * @version 1.0
 * @created 30-avr.-2013 14:44:57
 */
public class Matiere  {

	
	private Long idMatiere;
	private String codeMatiere;
	private String libelle;
	private Integer nbreHeures;


	public Matiere(){

	}

	public Matiere(String codeMatiere, String libelle , Integer nbreHeures) {
		this.codeMatiere = codeMatiere;
		this.libelle = libelle;
		this.setNbreHeures(nbreHeures);
	}

	public Integer getNbreHeures() {
		return nbreHeures;
	}
	public void setNbreHeures(Integer nbreHeures) {
		this.nbreHeures = nbreHeures;
	}

	public String getCodeMatiere() {
		return codeMatiere;
	}


	public void setCodeMatiere(String codeMatiere) {
		this.codeMatiere = codeMatiere;
	}


	public String getLibelle() {
		return libelle;
	}


	public void setLibelle(String libelle) {
		this.libelle = libelle;
	}

	public Long getIdMatiere() {
		return idMatiere;
	}

	public void setIdMatiere(Long idMatiere) {
		this.idMatiere = idMatiere;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((codeMatiere == null) ? 0 : codeMatiere.hashCode());
		result = prime * result
				+ ((idMatiere == null) ? 0 : idMatiere.hashCode());
		result = prime * result + ((libelle == null) ? 0 : libelle.hashCode());
		result = prime * result
				+ ((nbreHeures == null) ? 0 : nbreHeures.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Matiere other = (Matiere) obj;
		if (codeMatiere == null) {
			if (other.codeMatiere != null)
				return false;
		} else if (!codeMatiere.equals(other.codeMatiere))
			return false;
		if (idMatiere == null) {
			if (other.idMatiere != null)
				return false;
		} else if (!idMatiere.equals(other.idMatiere))
			return false;
		if (libelle == null) {
			if (other.libelle != null)
				return false;
		} else if (!libelle.equals(other.libelle))
			return false;
		if (nbreHeures == null) {
			if (other.nbreHeures != null)
				return false;
		} else if (!nbreHeures.equals(other.nbreHeures))
			return false;
		return true;
	}

	@Override
	public String toString() {
		return "Matiere [idMatiere=" + idMatiere + ", codeMatiere="
				+ codeMatiere + ", libelle=" + libelle + ", nbreHeures="
				+ nbreHeures + "]";
	}

	
}